#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;

struct mooncake{
	double n,s,price;
};
bool cmp(struct mooncake &a,struct mooncake &b){
	return a.price>b.price;
}
int main(){
	int n,d;
	cin>>n>>d;
	struct mooncake m[n];
	for(int i =0; i<n; ++i ){
		cin>>m[i].n;
	}
	for(int i=0; i<n; ++i ){
		cin>>m[i].s;
		m[i].price = m[i].s/m[i].n;
	}
	sort(m,m+n,cmp);
	double max = 0;
	for( int i=0; d; ++i ){
		if( m[i].n>d ) max = max+m[i].price*d,d=0;
		else max = max +m[i].s,d -=m[i].n;
	}
	cout<<fixed<<setprecision(2)<<max;
	return 0;
}
